﻿@using System.Web.UI.WebControls
@using VietTrips.Domain.Models
@using VietTrips.WebUI.Models
@model dynamic
@{
    ViewBag.Title = "Quản Lý Tài Khoản";
    UserProfile userProfile = ViewBag.UserModel;
    LocalPasswordModel passwordModel = ViewBag.PasswordModel;
}

@section featured {
    <div id="page_title">
    <div class="container clearfix">
        <div class="page-name">@ViewBag.Title</div>
        <div class="breadcrumb clearfix">
            <a href="@Url.Action("Index", "Home")">Trang Chủ</a>
            <span class="current-page">@ViewBag.Title</span>
             </div>
        </div>
    </div>
}

<div class="row clearfix pv-20">
    @if (ViewBag.HasLocalPassword)
    {
        <ul class="tabs searchTab">
            <li><a href="#password-tab" class="active"><span class="fa-lock mi"></span>Thay Đổi mật khẩu</a></li>
            <li><a href="#information-tab" id="infoTab"><span class="fa-sign-in mi"></span>Thông tin tài khoản</a></li>
        </ul><!-- tabs -->

        <ul class="tabs-content">
            @Html.Partial("_ChangePasswordPartial", passwordModel)
            @Html.Partial("_ChangeInformationPartial", userProfile);
        </ul>

        @*<div class="main-wrapper">
                <!-- những cái trong tag main-wrapper là thân trang còn nằm ngoài là footer và header -->
                <div class="v-card">
                    <div class="container">
                        <div class="inner">
                            <div class="row">
                                <ul class="tabs">
                                    <li><a href="#password-tab"> Quản lý mật khẩu</a></li>
                                    <li><a id="infoTab" href="#information-tab"> Thông tin tài khoản</a></li>
                                </ul>
                                <div class="tab_container">
                                    @Html.Partial("_ChangePasswordPartial", passwordModel)
                                    @Html.Partial("_ChangeInformationPartial", userProfile);
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        *@
    }
    else
    {
        @Html.Partial("_SetPasswordPartial")
    }

</div>

    @section style {
        <link href="~/Content/frontend/bootstrap/css/bootstrap-notify.css" rel="stylesheet" />
    }

    @section Scripts {
        <script src="~/Content/frontend/bootstrap/js/bootstrap-notify.js"></script>
        <script>
            jQuery(function ($) {

                @if (ViewBag.NotifyMessage != null && ViewBag.NotifyState != null)
            {
                <text>
                var message = '@Html.Raw(ViewBag.NotifyMessage)';
                var state = '@ViewBag.NotifyState';
                $('.bottom-right').notify({
                    message: { text: message },
                    type: state
                }).show();
                </text>
            }

                @if (ViewBag.InfoTabActive != null){
                <text>
                document.getElementById('infoTab').click();
                </text>
            }

                if ($.validator !== undefined) {
                    $.validator.addMethod('date',
                        function (value, element) {
                            if (this.optional(element)) {
                                return true;
                            }

                            var ok = true;
                            try {
                                $.datepicker.parseDate('dd/mm/yy', value);
                            } catch (err) {
                                ok = false;
                            }
                            return ok;
                        });
                };
            });
        </script>
    }
